#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>

int gval = 0;

int main()
{
  

  


  /*
  printf("i am a process,pid: %d, ppid: %d\n", getpid(),getppid());
  pid_t id = fork();

  if(id > 0)
  {
    while(1)
    {
      printf("我是父进程，pid: %d,ppid:%d,ret id:%d,gval:%d\n", getpid(),getppid(), id,gval);
      sleep(1);
    }
  }
  
  else if(id == 0)
  {
    while(1)
    {
      printf("我是子进程，pid: %d,ppid:%d,ret id:%d,gval:%d\n", getpid(),getppid(), id,gval);
      gval++;
      sleep(1);
    }
  }
  */


  /*
  (void)id;
  printf("i am a process,pid: %d, ppid: %d\n", getpid(),getppid());
  sleep(1);
  */

/*
  chdir("/home/kris");
  FILE *fp = fopen("lpg.txt", "w");
  if(fp == NULL)
  {
    perror("fopen");
    return 1;
   }
*/


/*  pid_t ppid = getppid();
  pid_t id = getpid();
  
  while(1)
  { 
    printf("hello,pid:%d,ppid:%d\n", id,ppid);
    sleep(1);
  }
*/ 
}
